﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/Default.master" AutoEventWireup="true"
    CodeBehind="OrderDetail.aspx.cs" Inherits="AUV5.Web.Pages.OrderDetail" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="/!js/orderDetail.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            var lastIsReq = "<%=lastIsRequest %>";

            if (Boolean.parse(lastIsReq)) {
                var reqSize = $("[name='divReqClose']").size();
                $("[name='divReqClose']").each(function (i) {
                    if (i < reqSize - 1) {
                        $(this).remove();
                    }
                });
            }
            else {
                $("[name='divReqClose']").remove();
            }

            $("[id$='imgBtnCompleted']").click(function () {
                var txtVal = $.trim($("[id$='txtOrderLogCompleted']").val());
                if (txtVal == "") {
                    alert("请输入留言内容");
                    return false;
                }
                else {
                    if (txtVal.length > 500) {
                        alert("留言内容不得大于500字");
                        return false;
                    }
                }
            });

            $("id$='btnReply'").click(function () {
                if ($.trim($("id$='txtReply'").val()) == "") {
                    alert("回复内容不能为空");
                    return false;
                }
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <input id="hidStr" name="hidStr" type="hidden" />
    <p class="returnorder">
        <<<a href="OrderList.aspx">回到我的服务订单</a></p>
    <div class="orderdetail">
        <p class="fl orderavatar">
            <asp:Image ID="imgBuyer" runat="server" />
        </p>
        <div class="fl">
            <p class="orderinfor">
                <span>订单号：<asp:Label ID="lblOrderCode" runat="server" Text=""></asp:Label></span>
                <span>
                    <asp:Label ID="lblOrderStatus" runat="server" Text=""></asp:Label></span>
            </p>
            <p class="orderdetailtitle">
                <asp:Label ID="lblServiceTitle" runat="server" Text=""></asp:Label></p>
        </div>
    </div>
    <p class="clear">
    </p>
    <div class="orderbuyer">
        <p class="fl">
            <asp:LinkButton ID="lbtnBuyer" runat="server"></asp:LinkButton>
            购买此服务于
            <asp:Label ID="lblOrderBeginTime" runat="server" Text=""></asp:Label>
        </p>
        <p class="fr">
            <asp:LinkButton ID="lbtnContractBuyer" runat="server" Text=""></asp:LinkButton></p>
    </div>
    <p class="clear">
    </p>
    <div class="ordermassage">
        <ul>
            <%foreach (var message in messagelist.OrderBy(m => m.GetDate()))
              {
            %>
            <%=message.Write()%>
            <%
              } %>
        </ul>
    </div>
    <p class="clear">
    </p>
    <p class="clear">
    </p>
    <div class="orderdialogmenu">
        <p id="btnSendOrderLog" runat="server" class="fl txtbule">
            发送消息</p>
        <p id="btnCompleteOrder" runat="server" class="fl txtgreen">
            发货</p>
        <p id="btnReplyOrder" runat="server" class="fl txtgrey">
            回复评价</p>
        <p id="btnCancelOrder" runat="server" class="fr txtred">
            取消订单</p>
    </div>
    <div class="dialogbar">
        <p class="dialogavarat">
            <asp:Image ID="imgSeller" runat="server" /></p>
        <div id="divDialog" class="fl dialog">
            <div id="divSendOrderLog" runat="server">
                <p class="iconblue dialogicon">
                </p>
                <div class="ordermaginfo  mar_left massageinfobluebg">
                    <p class="sentmag">
                        <asp:TextBox ID="txtOrderLog" runat="server" TextMode="MultiLine" class="bluetextarea"></asp:TextBox>
                    </p>
                    <p class="sentmag">
                        <asp:ImageButton ID="imgBtnSendOrderLog" class="imgSend" runat="server" ImageUrl="/!images/btn_sentoff.jpg"
                            OnClick="imgBtnSendOrderLog_Click" />
                    </p>
                </div>
            </div>
            <div id="divReply" runat="server" class="none">
                <p class="icongrey dialogicon">
                </p>
                <div class="ordermaginfo  mar_left massageinfogreybg">
                    <p class="sentinfo">
                        如果你已经完成此服务内容并发送给买家，请在此通知买家接收或者告知此服务的快递信息</p>
                    <p class="sentmag">
                        <asp:TextBox ID="txtReply" runat="server" TextMode="MultiLine" class="greytextarea"></asp:TextBox>
                    </p>
                    <p class="sentmag">
                        <asp:ImageButton ID="imgBtnReply" class="imgSend" runat="server" ImageUrl="/!images/btn_sentoff.jpg"
                            OnClick="imgBtnReply_Click" />
                    </p>
                </div>
            </div>
            <div id="divCompleteOrder" runat="server" class="none">
                <p class="icongreen dialogicon">
                </p>
                <div class="ordermaginfo  mar_left massageinfogreenbg">
                    <p class="sentinfo">
                        买家已发表评论，回复信息给买家吧</p>
                    <p class="sentmag">
                        <asp:TextBox ID="txtOrderLogCompleted" runat="server" TextMode="MultiLine" class="greentextarea"></asp:TextBox>
                    </p>
                    <p class="sentmag">
                        <asp:ImageButton ID="imgBtnCompleted" class="imgSend" runat="server" ImageUrl="/!images/btn_sentoff.jpg"
                            OnClick="imgBtnCompleted_Click" />
                    </p>
                </div>
            </div>
            <div id="divCancelOrder" runat="server" class="none">
                <p class="iconred dialogicon">
                </p>
                <div class="ordermaginfo  mar_left massageinforedbg">
                    <div class="cancellist">
                        <ul>
                            <li class="selected">
                                <p class="canceltitle">
                                    <asp:RadioButton ID="rdoBtnRequestClosed" runat="server" GroupName="cancel" Checked="true"
                                        name="rdoBtnCancel" Text="请求取消订单" />
                                </p>
                                <p class="canceltxt">
                                    提出合理的理由，请求买家主动取消此订单</p>
                            </li>
                            <li>
                                <p class="canceltitle">
                                    <asp:RadioButton ID="rdoBtnForceClosed" runat="server" GroupName="cancel" name="rdoBtnCancel"
                                        Text="强制取消订单" />
                                </p>
                                <p class="canceltxt">
                                    强制关闭此订单，同时退还买家已支付的费用（此操作会降低你的好评率和信誉度）</p>
                            </li>
                            <%-- <li>
                                <p class="canceltitle">
                                    <asp:RadioButton ID="RadioButton3" runat="server" GroupName="cancel" name="rdoBtnCancel"
                                        Text="没主意了？" />
                                </p>
                                <p class="canceltxt">
                                    遇到有关订单的问题了吗？<br />
                                    这里给你一些解决办法和小窍门</p>
                            </li>--%>
                        </ul>
                    </div>
                    <p class="dialogtxt">
                        给买家留言</p>
                    <p class="sentmag">
                        <asp:TextBox ID="txtOrderLogCancel" runat="server" TextMode="MultiLine" class="redtextarea"></asp:TextBox>
                    </p>
                    <p class="sentmag">
                        <asp:ImageButton ID="imgCancelOrder" class="imgSend" runat="server" ImageUrl="/!images/btn_sentoff.jpg"
                            OnClick="imgCancelOrder_Click" />
                    </p>
                </div>
            </div>
        </div>
    </div>
    <%--    <asp:Panel ID="pnlReply" runat="server">  
        <asp:TextBox ID="txtReply" runat="server" TextMode="MultiLine" class="greentextarea"></asp:TextBox>
        <asp:Button ID="btnReply" runat="server" Text="回复" OnClick="btnReply_Click" />
    </asp:Panel>--%>
</asp:Content>
